package io.gitee.welson.sensitive.util;

/**
 * @author welson
 */
public class SensitiveContext {
    /**
     * 判断是否需要脱敏，默认需要脱敏
     */
    private static final ThreadLocal<Boolean> DESENSITIZED = ThreadLocal.withInitial(() -> true);

    public static boolean needDesensitize() {
        return DESENSITIZED.get();
    }

    public static void markDesensitization(boolean needDesensitize) {
        DESENSITIZED.set(needDesensitize);
    }
}
